package com.xygz.orm.utils;

import com.xiyuan.smartutils.LambdaUtils;
import com.xiyuan.smartutils.function.SFunction;
import com.xygz.orm.SFunc;

import java.lang.reflect.Field;

/**
 * Lambda 工具类
 *
 * @author xiyuan-lgz 2023-09-19 @version v1.0.0 新建与整理
 */

@SuppressWarnings("all")
public class LBDA {
    public static <T, R> Field getField(SFunc<T, R> function) {
        return LambdaUtils.getField(function);
    }
    
    public static <T, R> String getFieldName(SFunc<T, R> function) {
        return getField(function).getName();
    }
    
    public static <T, R, C> Class<C> getImplClass(SFunc<T, R> function) {
        return function.getImplClass();
    }
    
    public static <E, P, R> Class<E> getInstanceProviderType(SFunction<P, R> function) {
        return function.getInstanceProviderType();
    }
}
